package com.communal.model.tarif;

import java.io.Serializable;

import javax.persistence.AssociationOverride;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Table;

/**
 * 
 * @author Created by andrey.kuznetsov <br>
 * @author Last modified by $Author$ <br>
 * @author Last modified on $Date$ at revision $Revision$ <br>
 */
@Entity
@Table(name = "tarif_internet")
@AttributeOverrides({
	@AttributeOverride(name="enabled", column=@Column(name="enabled")),
	@AttributeOverride(name="id", column=@Column(name="id")),
	@AttributeOverride(name="tarifName", column=@Column(name="tarif_name"))
})	
@AssociationOverride( name="model", joinColumns = @JoinColumn(name="model_id"))
public class TarifInternet extends Tarif implements Serializable{

	private static final long serialVersionUID = -2539876938870749649L;

	@Column(name = "type", unique = false, nullable = false, insertable = true, updatable = true)
	private Short type;
	
	@Column(name = "underSumma", unique = false, nullable = false, insertable = true, updatable = true)
	private Double underSumma;
	
	@Column(name = "overSumma", unique = false, nullable = false, insertable = true, updatable = true)
	private Double overSumma;
	
	@Column(name = "borderValue", unique = false, nullable = false, insertable = true, updatable = true)
	private Short borderValue;
	
	@Column(name = "unlimitSumma", unique = false, nullable = false, insertable = true, updatable = true)
	private Double unlimitSumma;

	/**
	 * Returns type of tarif (0 - with traffic limitations, 1 - unlimit) <br>
	 * @return {@link Short};
	 */
	public Short getType() {
		return type;
	}

	/**
	 * Sets type of tarif (0 - with traffic limitations, 1 - unlimit) <br>
	 * @param p_type - {@link Short};
	 */
	public void setType(Short p_type) {
		type = p_type;
	}

	/**
	 * Returns summa per Mb which user should pay if he not exceed border value <br>
	 * @return {@link Double};
	 */
	public Double getUnderSumma() {
		return underSumma;
	}

	/**
	 * Sets summa per Mb which user should pay if he not exceed border value <br>
	 * @param p_underSumma - {@link Double};
	 */
	public void setUnderSumma(Double p_underSumma) {
		underSumma = p_underSumma;
	}

	/**
	 * Returns summa per Mb which user should pay if he exceed border value <br>
	 * @return {@link Double};
	 */
	public Double getOverSumma() {
		return overSumma;
	}

	/**
	 * Sets summa per Mb which user should pay if he exceed border value <br>
	 * @param p_overSumma - {@link Double};
	 */
	public void setOverSumma(Double p_overSumma) {
		overSumma = p_overSumma;
	}

	/**
	 * Returns traffic limitation in Mb <br>
	 * @return {@link Short};
	 */
	public Short getBorderValue() {
		return borderValue;
	}

	/**
	 * Sets traffic limitation in Mb <br>
	 * @param p_borderValue - {@link Short};
	 */
	public void setBorderValue(Short p_borderValue) {
		borderValue = p_borderValue;
	}

	/**
	 * Returns summa for unlimit type of tarif <br>
	 * @return {@link Double};
	 */
	public Double getUnlimitSumma() {
		return unlimitSumma;
	}

	/**
	 * Sets summa for unlimit type of tarif <br>
	 * @param p_unlimitSumma - {@link Double};
	 */
	public void setUnlimitSumma(Double p_unlimitSumma) {
		unlimitSumma = p_unlimitSumma;
	}
	

}
